-- Experimental Thinder Compiler

module Main where
import qualified Lexer 
import qualified Parser 
import System(getArgs)

ioTokens :: [Lexer.Token] -> IO [Lexer.Token]
ioTokens tokens = do return tokens

ioThinder :: Parser.Thinder -> IO Parser.Thinder
ioThinder t = do return t

readSource :: FilePath -> IO String
readSource f = do x <- readFile f
                  return x

main = do
    args <- getArgs
    --putStrLn "Experimental Thinder Compiler"
    s <- readSource (head args)
    tokens <- (ioTokens $ Lexer.scan s)
    --putStrLn ("\nTokens:\n" ++ (show tokens))
    --putStrLn "\nParse tree:"
    parseTree <- (ioThinder $ Parser.parse tokens)
    print parseTree
    
